package org.shoukaiseki.common.exception

import org.shoukaiseki.common.utils.StringUtils
import java.lang.RuntimeException

open class VerificationException : RuntimeException {
    constructor(msg: String?) : super(msg) {}
    constructor(message: String?, t: Throwable?) : super(message, t) {}

    override var message: String=""
        get() {
                return field
        }
        set(value) {field=value}

    open fun format(vararg params:Any):VerificationException{
        if (this.message==null) {
            return this
        }
        //可变参数向下传递时加上 *
        this.message= StringUtils.format(super.message,*params)
        return this
    }
}
